#include "loginwindow.h"
#include "ui_loginwindow.h"
#include <QMessageBox>
#include"ThreadController.h"
#include"friendlist.h"
#include"enrollwindow.h"
Loginwindow::Loginwindow(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::Loginwindow)
{
    ui->setupUi(this);
}

Loginwindow::~Loginwindow()
{
    delete ui;
}

//void Loginwindow::GetTCPSocket(TCPSocket *socket){

//   mysocket=socket;
//}

void Loginwindow::on_login_clicked()
{

emit sig_task_login_start(ui->account->text(),ui->password->text());

}
void Loginwindow:: open(bool a){
    if(a){
         close();
         emit openfriendlist();
         emit sendid(ui->account->text());
    }
    else{
        QMessageBox::warning(this, tr("Waring"),
                                     tr("账户或密码错误！"),
                                      QMessageBox::Yes);
                ui->password->clear();
               ui->account->clear();

}
}
void Loginwindow::on_sign_clicked()
{
    emit openenroll();
//  enrollwindow *sign=new enrollwindow();
//  sign->show();



}
void Loginwindow::opencheck(){
//sendcheck* send_check=new sendcheck();
//send_check->show();
    emit(sendcheck());


}
void Loginwindow::on_findpassword_clicked()
{

    emit(openpassword());
}
